import { reactive } from "vue"

export interface IDrawer {
    title: string,
    visible: boolean,
    size: string
}

export default function useDrawer() {
    // 弹窗属性
    const drawer = reactive<IDrawer>({
        title: '',
        visible: false,
        size: '30%'
    })
    // 弹窗展示
    const onShowDrawer = () => {
        drawer.visible = true
    }
    // 弹窗关闭
    const onCloseDrawer = () => {
        drawer.visible = false
    }

    return { drawer, onShowDrawer, onCloseDrawer }
}